package icegps.com.bhmap.evaluator;

import android.animation.TypeEvaluator;

import icegps.com.bhmap.bean.TargetPoint;

/**
 * Created by 111 on 2017/12/8.
 */

public class TargetPointEvaluator implements TypeEvaluator<TargetPoint> {

    @Override
    public TargetPoint evaluate(float fraction, TargetPoint startValue, TargetPoint endValue) {
        double resultX = startValue.getPointX() + fraction * (endValue.getPointX() - startValue.getPointX());
        double resultY = startValue.getPointY() + fraction * (endValue.getPointY() - startValue.getPointY());
        TargetPoint targetPoint = new TargetPoint();
        targetPoint.setPointX(resultX);
        targetPoint.setPointY(resultY);

        return targetPoint;
    }
}
